home *** CD-ROM | disk | FTP | other *** search
/ Online Today 2000 January / Onto0100.iso / pc / Browser / HTML Kurse / selfhtml / zmazecan.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-10-14  |  1.5 KB  |  52 lines

  1. import java.awt.Canvas;
  2. import java.awt.Component;
  3. import java.awt.Graphics;
  4. import java.awt.Rectangle;
  5.  
  6. class zmazecan extends Canvas {
  7.    private boolean invalidated;
  8.    public zmaze3d zmaze3d;
  9.    // $FF: renamed from: p zmazescr
  10.    public zmazescr field_0;
  11.    public int previousHeight;
  12.    public int previousWidth;
  13.    public Rectangle rectangle;
  14.    public boolean resize;
  15.  
  16.    zmazecan(zmaze3d var1) {
  17.       this.zmaze3d = var1;
  18.       this.invalidated = false;
  19.       this.previousWidth = 0;
  20.       this.previousHeight = 0;
  21.       this.field_0 = new zmazescr(this);
  22.       this.field_0.start();
  23.    }
  24.  
  25.    public void paint(Graphics var1) {
  26.       if (!this.invalidated) {
  27.          this.invalidated = true;
  28.          ((Component)this).hide();
  29.          ((Component)this).show();
  30.       } else {
  31.          this.invalidated = false;
  32.          this.rectangle = ((Component)this).bounds();
  33.          if (this.previousWidth == this.rectangle.width && this.previousHeight == this.rectangle.height) {
  34.             this.resize = false;
  35.          } else {
  36.             if (this.zmaze3d.hexagonalRooms) {
  37.                this.zmaze3d.message.setText("Verwenden Sie Home, Up, PgUp, Ende, Dn Pfeil, oder PgDn zum Spielen.");
  38.             } else {
  39.                this.zmaze3d.message.setText("Verwenden Sie die Pfeiltasten zum Spielen.");
  40.             }
  41.  
  42.             this.zmaze3d.solutionDisplayed = false;
  43.             this.resize = true;
  44.             this.previousWidth = this.rectangle.width;
  45.             this.previousHeight = this.rectangle.height;
  46.          }
  47.  
  48.          this.field_0.restart = true;
  49.       }
  50.    }
  51. }
  52.